﻿<controls:ChildWindow x:Class="Rage.UI.DG_ToRLoader_AbilityPackage" Title="Load Items from ToR Data Files"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
  xmlns:UI="clr-namespace:Rage.UI"
  WindowStartupLocation="CenterOwner" Width="1024" Height="900">

  <controls:ChildWindow.Resources>
    <UI:NullToVisibilityConverter x:Key="NullToVisibilityConverter1" />
    <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type GroupItem}">
            <Expander x:Name="exp" IsExpanded="True" Background="PowderBlue" Foreground="Black" BorderBrush="AliceBlue">
              <Expander.Header>
                <TextBlock Text="{Binding Name}" />
              </Expander.Header>
              <ItemsPresenter />
            </Expander>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </controls:ChildWindow.Resources>

  <Grid x:Name="LayoutRoot" Margin="2">
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Grid>
      <Grid.ColumnDefinitions>
        
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        
      </Grid.RowDefinitions>

      <DataGrid x:Name="ItemGrid" AutoGenerateColumns="True" MinWidth="500" MinHeight="300" ItemsSource="{Binding}">
        <DataGrid.GroupStyle>
          <GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
            <GroupStyle.Panel>
              <ItemsPanelTemplate>
                <DataGridRowsPresenter/>
              </ItemsPanelTemplate>
            </GroupStyle.Panel>
          </GroupStyle>
        </DataGrid.GroupStyle>
      </DataGrid>
    </Grid>

    <StackPanel Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left">
      <TextBlock x:Name="LB_Count" Margin="4" Text="\{0\} Items" />
    </StackPanel>
    <Button x:Name="BT_ImportItems" Content="Import" Click="BT_Import_Click" Width="100" Height="23" HorizontalAlignment="Right" Margin="0,6,179,0" Grid.Row="1" />
    <Button x:Name="BT_ExtractImages" Content="Extract Images" Click="BT_ExtractImages_Click" Width="100" Height="23" HorizontalAlignment="Right" Margin="0,6,77,0" Grid.Row="1" />
    <Button x:Name="BT_OK" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,6,0,0" Grid.Row="1" />
  </Grid>
</controls:ChildWindow>